#include <iostream>
#include <string>
using namespace std;

const int kMaxN = 10;

int ans[kMaxN], len;
bool del[kMaxN];
string s;

bool IsPalindrome() {
  string tmp = "";
  for (int i = 0; i < s.size(); i++) {
    if (del[i]) {
      continue;
    }
    tmp = tmp + s[i];
  }
  for (int i = 0, j = ((int)tmp.size()) - 1; i < j; i++, j--) {
    if (tmp[i] != tmp[j]) {
      return false;
    }
  }
  return true;
}

void DFS(int dep, char last = '0') {
  if (len != -1) {
    return;
  }
  if (dep == s.size()) {
    if (IsPalindrome()) {
      len = 0;
      for (int i = 0; i < s.size(); i++) {
        if (del[i]) {
          ans[len++] = i;
        }
      }
    }
    return;
  }
  if (s[dep] <= last) {
    del[dep] = true;
    DFS(dep + 1, s[dep]);
    del[dep] = false;
  }
  DFS(dep + 1, last);
}

int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int T;
  for (cin >> T; T; T--) {
    int n;

    cin >> n >> s;
    len = -1;
    DFS(0);
    cout << len << "\n";
    if (len >= 0) {
      for (int i = 0; i < len; i++) {
        cout << ans[i] + 1 << " ";
      }
      cout << "\n";
    }
  }
  return 0;
}